<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateHousePricesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('house_prices', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('average')->unsigned()->default(0)->comment('均价');
            $table->integer('region_id')->unsigned()->comment('地区id');
            $table->string('region_name')->nullable()->comment('地区名称');
            $table->integer('month')->unsigned()->comment('月份');
            $table->integer('count')->unsigned()->comment('产品数');
            $table->string('type')->nullable()->comment('类型：newhouse 新房 hand 二手房 rental 出租房');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('house_prices');
    }
}
